package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface ReportMapper extends BaseMapper {
    @Select("select count(tm.id) as membercounts , " +
            "CONCAT(rd.fyear,'-',rd.fmonth) as yearandmonth " +
            "from rpt_date as rd ,t_member as tm  " +
            "where rd.fdate = tm.REGTIME " +
            "and rd.fyear = year(now())   " +
            "GROUP BY rd.fmonth")
    List<Map> findMemberCountByMonth();

    @Select("select count(ts.id) as value ,ts.name  " +
            "from   t_order tor, t_setmeal ts " +
            "where  tor.setmeal_id  = ts.id " +
            "group by ts.id")
    List<Map> findsetmealProportion();


}
